package org.sixtythousand.joker;

import org.sixtythousand.joker.util.AbstractLifeCycle;
import org.sixtythousand.joker.util.Callback;

import java.io.IOException;
import java.util.concurrent.Executor;

/**
 * @author zhoulk
 * @date 2023/10/11 10:55
 * @desc
 */
public abstract class AbstractConnection extends AbstractLifeCycle implements Connection {

    private final JChannel channel;
    protected Callback channelCallback;
    protected Executor executor;


    protected AbstractConnection(JChannel channel) {
        this.channel = channel;
    }

    @Override
    public JChannel getChannel() {
        return channel;
    }

    @Override
    public Executor getExecutor() {
        return executor;
    }

    @Override
    public void close() throws IOException {

    }

    @Override
    public void stop() {

    }

    @Override
    public void read() {

    }

    abstract protected void doRead(Object msg);


}
